package com.youlei.newgraduateproject.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author youlei
 * @version 1.0
 * @Date 2021-04-21-21:56
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonResult<T> implements Serializable {
/**
    状态码,如404
*/
    private Integer code;
/**
    异常信息或成功说明
*/
    private String message;
/**
    通用的类
*/
    private T data;
/**
    data通用数据为空时的构造器
*/
    public CommonResult(Integer code, String  message){
        this(code,message,null);
    }
    public CommonResult(T data){
        this(200,"操作成功",data);
    }



}
